<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>C Test Function Reference &mdash; MCC DAQ HAT Library 1.5.0 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b76e3c8a" />
      <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />

  
    <link rel="shortcut icon" href="_static/favicon.ico"/>
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="_static/jquery.js?v=5d32c60e"></script>
        <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="_static/documentation_options.js?v=e0a75244"></script>
        <script src="_static/doctools.js?v=888ff710"></script>
        <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="index.html" class="icon icon-home">
            MCC DAQ HAT Library
          </a>
              <div class="version">
                1.5.0
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul>
<li class="toctree-l1"><a class="reference internal" href="overview.html">Hardware Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="hardware.html">Installing the DAQ HAT board</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installing and Using the Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="c.html">C Library Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Library Reference</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">MCC DAQ HAT Library</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">C Test Function Reference</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/c_test.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="c-test-function-reference">
<h1>C Test Function Reference<a class="headerlink" href="#c-test-function-reference" title="Link to this heading"></a></h1>
<p>These functions are included for manufacturing test and not targeted for the end user.</p>
<section id="mcc-118-test-functions">
<h2>MCC 118 test functions<a class="headerlink" href="#mcc-118-test-functions" title="Link to this heading"></a></h2>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p>Function</p></td>
<td><p>Description</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#c.mcc118_test_clock" title="mcc118_test_clock"><code class="xref c c-func docutils literal notranslate"><span class="pre">mcc118_test_clock()</span></code></a></p></td>
<td><p>Test the CLK pin.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#c.mcc118_test_trigger" title="mcc118_test_trigger"><code class="xref c c-func docutils literal notranslate"><span class="pre">mcc118_test_trigger()</span></code></a></p></td>
<td><p>Test the TRIG pin.</p></td>
</tr>
</tbody>
</table>
<dl class="c function">
<dt class="sig sig-object c" id="c.mcc118_test_clock">
<span class="target" id="mcc118_8h_1a21adc96edc8eb72c6cd0b0df27828537"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">mcc118_test_clock</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">address</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">mode</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.mcc118_test_clock" title="Link to this definition"></a><br /></dt>
<dd><p>Test the CLK pin. </p>
<p>This function will return RESULT_BUSY if called while a scan is running.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>address</strong> – The board address (0 - 7). Board must already be opened. </p></li>
<li><p><strong>mode</strong> – The CLK pin mode<ul>
<li><p>0 = input</p></li>
<li><p>1 = output low</p></li>
<li><p>2 = output high</p></li>
<li><p>3 = output 1 kHz square wave </p></li>
</ul>
</p></li>
<li><p><strong>value</strong> – Receives the value at the CLK pin after setting the mode. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4"><span class="std std-ref">Result code</span></a>, <a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4af3d0d72febdcc6491554576ed31f686e"><span class="std std-ref">RESULT_SUCCESS</span></a> if successful. </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.mcc118_test_trigger">
<span class="target" id="mcc118_8h_1aee169bf587205b28dc8f9e6a64431997"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">mcc118_test_trigger</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">address</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">state</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.mcc118_test_trigger" title="Link to this definition"></a><br /></dt>
<dd><p>Test the TRIG pin by returning the current state. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>address</strong> – The board address (0 - 7). Board must already be opened. </p></li>
<li><p><strong>state</strong> – Receives the TRIG pin state (0 or 1.) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4"><span class="std std-ref">Result code</span></a>, <a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4af3d0d72febdcc6491554576ed31f686e"><span class="std std-ref">RESULT_SUCCESS</span></a> if successful. </p>
</dd>
</dl>
</dd></dl>

</section>
<section id="mcc-172-test-functions">
<h2>MCC 172 test functions<a class="headerlink" href="#mcc-172-test-functions" title="Link to this heading"></a></h2>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p>Function</p></td>
<td><p>Description</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#c.mcc172_test_signals_read" title="mcc172_test_signals_read"><code class="xref c c-func docutils literal notranslate"><span class="pre">mcc172_test_signals_read()</span></code></a></p></td>
<td><p>Read the state of the clock, sync, and trigger signals.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#c.mcc172_test_signals_write" title="mcc172_test_signals_write"><code class="xref c c-func docutils literal notranslate"><span class="pre">mcc172_test_signals_write()</span></code></a></p></td>
<td><p>Write values to the clock and sync signals.</p></td>
</tr>
</tbody>
</table>
<dl class="c function">
<dt class="sig sig-object c" id="c.mcc172_test_signals_read">
<span class="target" id="mcc172_8h_1ace025080095f19453c370d573b7a1dc4"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">mcc172_test_signals_read</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">address</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clock</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">sync</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">trigger</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.mcc172_test_signals_read" title="Link to this definition"></a><br /></dt>
<dd><p>Read the state of shared signals for testing. </p>
<p>This function reads the state of the ADC clock, sync, and trigger signals. Use it in conjunction with <a class="reference internal" href="c.html#mcc172_8h_1a7bd943e975298f3ee694c2ccea682386"><span class="std std-ref">mcc172_a_in_clock_config_write()</span></a> and <a class="reference internal" href="c.html#mcc172_8h_1a46ab58e3b3b542c5fee59d9b1454fda2"><span class="std std-ref">mcc172_trigger_config()</span></a> to put the signals into slave mode then set values on the signals using the Pi GPIO pins.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>address</strong> – The board address (0 - 7). Board must already be opened. </p></li>
<li><p><strong>clock</strong> – Receives the current logic level of the ADC clock. </p></li>
<li><p><strong>sync</strong> – Receives the current logic level of sync. </p></li>
<li><p><strong>trigger</strong> – Receives the current logic level of trigger. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4"><span class="std std-ref">Result code</span></a>, <a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4af3d0d72febdcc6491554576ed31f686e"><span class="std std-ref">RESULT_SUCCESS</span></a> if successful. </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.mcc172_test_signals_write">
<span class="target" id="mcc172_8h_1a7b512aeb1cf780d4619d90f70baffb1b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">mcc172_test_signals_write</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">address</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">mode</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">clock</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">sync</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.mcc172_test_signals_write" title="Link to this definition"></a><br /></dt>
<dd><p>Write values to shared signals for testing. </p>
<p>This function puts the shared signals into test mode and sets them to the specified state. The signal levels can then be read on the Pi GPIO pins to confirm.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>address</strong> – The board address (0 - 7). Board must already be opened. </p></li>
<li><p><strong>mode</strong> – Set to 1 for test mode, 0 to return to normal operation. </p></li>
<li><p><strong>clock</strong> – The value to write to the ADC clock when in test mode. </p></li>
<li><p><strong>sync</strong> – The value to write to sync when in test mode. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4"><span class="std std-ref">Result code</span></a>, <a class="reference internal" href="c.html#daqhats_8h_1ad8097859ab1bdd06be52a8421df152d4af3d0d72febdcc6491554576ed31f686e"><span class="std std-ref">RESULT_SUCCESS</span></a> if successful. </p>
</dd>
</dl>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2020, Measurement Computing.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>